package com.ag.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbEventReport entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_EVENT_REPORT", schema = "dbo", catalog = "AGDB")
public class TbEventReport implements java.io.Serializable {

	// Fields

	private String EId;
	private TbUser tbUser;
	private TbEvent tbEvent;
	private String erContent;
	private Date erDate;
	private String a;
	private String b;
	private String c;
	private Set<TbEventReportAudit> tbEventReportAudits = new HashSet<TbEventReportAudit>(
			0);

	// Constructors

	/** default constructor */
	public TbEventReport() {
	}

	/** minimal constructor */
	public TbEventReport(String EId, TbEvent tbEvent) {
		this.EId = EId;
		this.tbEvent = tbEvent;
	}

	/** full constructor */
	public TbEventReport(String EId, TbUser tbUser, TbEvent tbEvent,
			String erContent, Date erDate, String a, String b, String c,
			Set<TbEventReportAudit> tbEventReportAudits) {
		this.EId = EId;
		this.tbUser = tbUser;
		this.tbEvent = tbEvent;
		this.erContent = erContent;
		this.erDate = erDate;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbEventReportAudits = tbEventReportAudits;
	}

	// Property accessors
	@Id
	@Column(name = "E_ID", unique = true, nullable = false, length = 10)
	public String getEId() {
		return this.EId;
	}

	public void setEId(String EId) {
		this.EId = EId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "U_ID")
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "E_ID", unique = true, nullable = false, insertable = false, updatable = false)
	public TbEvent getTbEvent() {
		return this.tbEvent;
	}

	public void setTbEvent(TbEvent tbEvent) {
		this.tbEvent = tbEvent;
	}

	@Column(name = "ER_CONTENT", length = 4000)
	public String getErContent() {
		return this.erContent;
	}

	public void setErContent(String erContent) {
		this.erContent = erContent;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ER_DATE", length = 23)
	public Date getErDate() {
		return this.erDate;
	}

	public void setErDate(Date erDate) {
		this.erDate = erDate;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbEventReport")
	public Set<TbEventReportAudit> getTbEventReportAudits() {
		return this.tbEventReportAudits;
	}

	public void setTbEventReportAudits(
			Set<TbEventReportAudit> tbEventReportAudits) {
		this.tbEventReportAudits = tbEventReportAudits;
	}

}